<!--
//******************************************************************
//* Copyright (c) 2004 Ford Motor Company. All Rights Reserved.
//*
//*
//* $$Workfile:   ProductionVolumesMix.jsp  $$
//* $$Revision:   1.7  $$
//* $$Author:   TMALDON4  $$
//* $$Date:   Apr 29 2009 08:00:04  $$
//*
//* Description: Description of file goes here!!!
//******************************************************************
-->
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic"
	prefix="logic"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean"
	prefix="bean"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html"
	prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display-el"%>
<%@ taglib uri="ford-arg/tags" prefix="ft"%>

<script language="javascript">

	function calculateMix(){
		document.ProductionVolumesMixForm.section.value="INIT";
		document.ProductionVolumesMixForm.action = "ProductionVolumesMixActionCalculateMix.do";
		document.ProductionVolumesMixForm.submit();
	}
	function calculateMixPendientes(){
		document.ProductionVolumesMixForm.section.value="INIT";	
		document.ProductionVolumesMixForm.action = "ProductionVolumesMixActionCalculateMixPendientes.do";
		document.ProductionVolumesMixForm.submit();
	}	
	function clearFindCatalogs(){
		document.ProductionVolumesMixForm.section.value="INIT";	
		document.ProductionVolumesMixForm.action = "ProductionVolumesMixActionClear.do";
		document.ProductionVolumesMixForm.submit();
	}
	function showCatalogs(){
		document.ProductionVolumesMixForm.section.value="INIT";	
		document.ProductionVolumesMixForm.action = "ProductionVolumesMixActionFind.do";
		document.ProductionVolumesMixForm.submit();
	}
	function editMix(){
		document.ProductionVolumesMixForm.section.value="SAVE";	
		document.ProductionVolumesMixForm.action = "ProductionVolumesMixActionEdit.do";
	}
	function saveVolumes(){
		document.ProductionVolumesMixForm.section.value="SAVE";	
		document.ProductionVolumesMixForm.action = "ProductionVolumesMixActionSave.do";
		document.ProductionVolumesMixForm.submit();
	}

</script>
<table>
	<tr>
		<td colspan="2">
		<h2><bean:message key="productionVolumesMix.label" /></h2>
		</td>
	</tr>
</table>
<br />
<html:form action="/ProductionVolumesMixActionFind">

	<html:hidden property="section" />

	<bean:define id="productionVolumesMix">
		<bean:message key="productionVolumesMix.label" />
	</bean:define>
	<bean:define id="catalogo">
		<bean:message key="productionVolumesMix.label.catalog" />
	</bean:define>
	<bean:define id="actual">
		<bean:message key="productionVolumesMix.label.actual" />
	</bean:define>
	<bean:define id="forcasted">
		<bean:message key="productionVolumesMix.label.forcasted" />
	</bean:define>
	<bean:define id="mixSearch">
		<bean:message key="productionVolumesMix.label.mixSearch" />

	</bean:define>
	<bean:define id="mixSearchAnt">
		<bean:message key="productionVolumesMix.label.mixSearchAnt" />

	</bean:define>

	<%-- Panel de busqueda compartida --%>
	<table class="no_border" style="width:800px">
		<tr>
			<td class="text_blue_bold align_left" colspan="100%">
				<bean:message key="label.search" />
			</td>
		</tr>
		<tr height="10">

		</tr>
		<tr>
			<td class="text_blue_bold align_left">
				<bean:message key="label.vehicleLine" />
			</td>
			<td class="align_left">
				<html:select property="vehicleLineF">
					<html:options collection="optionVL" property="cas012VehicleCodeC"
						labelProperty="cas012VehicleCodeC" />
				</html:select>
			</td>
			<td class="text_blue_bold align_left" colspan="1">
				<bean:message key="productionVolumesMix.label.mixDate" />&nbsp;&nbsp;
				<html:select property="monthF">
					<html:options collection="optionMix" property="label"
					labelProperty="value" />
				</html:select>
				<bean:message key="label.year" />&nbsp;&nbsp;
				<html:text property="yearF" maxlength="10" size="9" />
			</td>
			<td class="align_right">
				<html:button property="clean" styleClass="button_small" onclick="clearFindCatalogs();">
				<bean:message key="label.clean" />
				</html:button>
			</td>
			<td class="align_left">
				<html:button property="find" onclick="showCatalogs();" styleClass="button_small">
					<bean:message key="label.find" />
				</html:button>
			</td>
		</tr>
	</table>
	<!-- Fin de panel de busqueda -->

	<br />
	<div class="edit_out align_center" style="width:800px;" >
	<div class="edit align_center" style="width: 800px;" >
		<table style="width: 800px;" class="no_border">
			<tr>
				<td class="text_blue_bold align_left" style="width: 33%">
					<bean:message key="productionVolumesMix.label.catalog" />
				</td>
				<td class="text_blue_bold align_left" style="width: 33%">
					<bean:message key="productionVolumesMix.label.actual" />
				</td>
				<td class="text_blue_bold align_left" style="width: 33%">
					<bean:message key="productionVolumesMix.label.forcasted" />
				</td>												
			</tr>
			<tr>
				<td class="align_left">
					<bean:write name="ProductionVolumesMixForm" property="catalogName" />
				</td>
				<td class="align_left">
					<html:text styleId="volActual" name="ProductionVolumesMixForm" property="volActual" maxlength="10" size="15"/>
				</td>
				<td class="align_left">
					<html:text styleId="volForecast" name="ProductionVolumesMixForm" property="volForecast" maxlength="10" size="15"/>
				</td>								
				<td align="right" colspan="3">
					<html:button property="saveVolumnes" styleClass="button_small" onclick="saveVolumes();">
						<bean:message key="productionVolumesMix.label.saveVolumes" />
					</html:button>
				</td>
			</tr>
		</table>
	</div>
	</div>	
	
	<br />
	<table class="no_border" style="width: 500px;">
		<tr>
			<td><ft:saveActivePageNumber /><display-el:table class="table1"
				style="width: 400px;" cellpadding="5" uid="catalog" pagesize="15"
				name="sessionScope.ProductionVolumesMixForm.catalogS"
				excludedParams="*"
				requestURI="ProductionVolumesMixActionPaginate.do"
				decorator="ar.com.ford.it.fullEconomics.view.displaytag.MixDecorator">
				<display-el:column title="${catalogo}" property="catalogName"
					style="width: 35%;"
					class="cell1 text_bold border1_right border1_top align_left"
					headerClass="header border_right">
				</display-el:column>
				<display-el:column title="${actual}"
					property="teesp11Volume.eesp11VolumActualQuantityQ"
					style="width: 25%;"
					class="cell1 text_bold border1_right border1_top align_left"
					headerClass="header border_right">
				</display-el:column>
				<display-el:column title="${forcasted}"
					property="teesp11Volume.eesp11VolumFutureQuantityQ"
					style="width: 25%;"
					class="cell1 text_bold border1_right border1_top align_left"
					headerClass="header border_right">
				</display-el:column>
				<display-el:column title="${mixSearch}" property="porcentajeMix"
					style="width: 25%;"
					class="cell1 text_bold border1_right border1_top align_left"
					headerClass="header border_right">
				</display-el:column>
				<display-el:column title="${mixSearchAnt}"
					property="porcentajeMixAnterior" style="width: 25%;"
					class="cell1 text_bold border1_right border1_top align_left"
					headerClass="header border_right">
				</display-el:column>
				<display-el:column title="${actionTitle}" style="width: 25%;"
					class="cell1 text_bold border1_right border1_top align_left"
					headerClass="header border_right">
					<html:submit property="editMapped(${catalog_rowNum})"
						styleClass="button" onclick="editMix();">
						<bean:message key="label.edit" />
					</html:submit>&nbsp;
				</display-el:column>
				</display-el:table>
			</td>
			<td>
				<table class="no_border" style="width: 300px;">
					<tr>
						<td class="text_blue_bold align_left">
							<bean:message key="productionVolumesMix.label.mixCalculation" />
						</td>
					</tr>
					<tr>
						<td align="left">
							<bean:message key="productionVolumesMix.label.mixCalculation" />
						</td>
					</tr>
					<tr>
						<td align="left">
							<bean:message key="productionVolumesMix.label.textMix" />
						</td>
					</tr>
					<tr>
						<td align="left">
							<html:select property="colorF">
								<html:options collection="catalogColor"
									property="cas003ColorCodeC" labelProperty="cas003ColorNameN" />
							</html:select>
						</td>
					</tr>
					<tr>
						<td align="left">
							<html:button property="calculate" styleClass="button_small" onclick="calculateMix();">
								<bean:message key="productionVolumesMix.label.calculateMix" />
							</html:button>
						</td>
					</tr>
					<tr>
						<td align="left">
							<html:button property="calculate" styleClass="button_small" onclick="calculateMixPendientes();">
								<bean:message key="productionVolumesMix.label.calculateMixPendientes" />
							</html:button>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</html:form>
